package io.github.linpeilie.model;

import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping;
import lombok.Data;
import org.babyfish.jimmer.sql.Entity;
import org.babyfish.jimmer.sql.Id;

@Entity
@AutoMapper(target = BookInput.class)
public interface Book {
//    io.github.linpeilie.model.BookToBookInputMapper
    @Id
    @AutoMapping(target = "id", conditionExpression = "java(org.babyfish.jimmer.ImmutableObjects.isLoaded(source, \"id\"))")
    long id();
    BookStore store();
}

//@Data
//public class Book {
//    private Long id;
//    private Long storeId;
//}